<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @property bool $type 类型:1=支付宝,2=微信,3=银行卡
 * @property int $id
 * @property int $user_id
 * @property string $account 账号
 * @property string $bank 银行名称
 * @property string $bank_name 开户行名称
 * @property string $createtime
 * @property string $name 姓名
 * @property-read mixed $type_text
 * @mixin \think\Model
 */
class UserAccount extends Model
{
	protected $createTime = 'createtime';
	protected $updateTime = 'updatetime';
	protected $append = [
		'type_text'
	];
	
	function getTypeTextAttr($value,$data)
	{
		$value = $value ?? $data['type'];
		$list = [ '1' => '支付宝','2'=>'微信','3'=>'银行卡'];
		return $list[$value] ?? '';
	}
}
